package com.day10.java;

public abstract class Traffic {
    public abstract  void drive();
}
    class Car extends Traffic {

        @Override
        public void drive() {
            System.out.println("滴滴...");
        }
    }
    class Bicycle extends Traffic{
        @Override
        public void drive() {
            System.out.println("蹬蹬噔...");

        }
    }
    class  Test {
        public static void main(String[] args) {
            Traffic[] arr = {new Car(), new Bicycle(), new Car(), new Bicycle()};
            for (int i = 0; i < arr.length; i++) {
                arr[i].drive();
            }
        }
    }



